\documentclass[t,12pt,aspectratio=169]{beamer} % 16:9 宽屏比例，适合现代投影
\usepackage{ctex} % 中文支持
\usepackage{amsmath, amssymb} % 数学公式与符号
\usepackage{graphicx, color}
\usepackage{url}
\usepackage{verbatim}

% 主题设置（推荐简洁风格）
\usetheme{Madrid}
\usecolortheme{default} % 可选：seahorse, beaver, dolphin 等

\title{第七章：统计量及其分布}
\author{MSS ET AL}
\date{2018年5月}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{本章知识点}

\begin{itemize}

\item  假设检验的步骤，$p$值的概念

\item  正态总体参数的假设检验：单样本，双样本

\item  其它分布参数的检验：指数，比率，大样本

\item  似然比检验，$\chi^2$ 分布拟合检验

\item  正态性检验：正态概率图，W检验，EP检验

\item  非参数检验：游程检验，符号检验，秩和检验

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{本章习题}

\begin{itemize}

\item  (7.1) 1, 3, 5, 7, 8.

\item  (7.2) 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23.

\item  (7.3) 1, 3, 5, 7, 9, 11.

\item  (7.4) 1, 5, 6, 7, 9, 11, 13, 15.

\item  (7.5) 1, 3.

\item  (7.6) 1, 2, 3, 4, 5, 6, 7, 8.

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }


问：假设检验的基本思想是什么？

答：

\begin{itemize}
\item 在假设 $H_0$ 为真的条件下，如果样本观测得到的是小概率事件（用样本构造的统计量来衡量），例如概率小于 $\alpha=0.05$, 则认为原假设 $H_0$ 不太可能为真，从而拒绝该假设。
%\item 
%\item 
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }


问：某厂生产的合金强度服从正态分布 $N(\theta,16)$, 其中 $\theta$ 的设定值不小于110帕。某天从生产的产品中随机抽取25块合金，测得其强度值为 $x_1,\cdots,x_n$, 均值为 $\bar{x}=108.2$ 帕。问当日生产是否正常？

答：

\begin{itemize}
\item 参数集 $\Theta_0=\{ \theta:\theta\ge 110\}$, $\Theta_1=\{\theta:\theta<110\}$.
\item 生产正常即命题 $\theta\in\Theta_0$. 在 $\theta\in\Theta_0$ 假设下，若 $\mathbb{P}(\bar{X}\le 108.2)$ 是小概率，则拒绝该假设。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：叙述假设检验的基本步骤。

答：

\begin{enumerate}
\item 建立假设：$H_0:\theta\in\Theta_0$ v.s. $H_1:\theta\in\Theta_1$.
\item 选择检验统计量，给出拒绝域的形式。
\item 选择显著性水平，给出拒绝域 $W$.
\item 代入观测值，计算统计量，是否落入拒绝域。
\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：解释假设检验的两类错误。

答：

\begin{itemize}
\item 第一类错误称为“弃真”：原假设为真，观测值却落入拒绝域。概率为 $\alpha=\mathbb{P}(X\in W | H_0)$.
\item 第二类错误称为“取伪”：原假设不真，但观测值没落入拒绝域。概率为 $\beta=\mathbb{P}(X\in \bar{W} | H_1)$.
\end{itemize}


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：什么是功效函数？

答：设下述检验问题的拒绝域为 $W$, 
\[ H_0:\theta\in\Theta_0 \,\,\mathrm{v.s.}\,\, H_1:\theta\in\Theta_1. \]
则样本观测值落在拒绝域的概率称为该检验的{\color{red}功效函数（势函数）}，记为
\[ g(\theta)=\mathbb{P}_\theta(X\in W),\,\, \theta\in\Theta:=\Theta_0\cup \Theta_1. \]


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：某厂生产的合金强度服从正态分布 $N(\theta,16)$, 其中 $\theta$ 的设定值不小于110帕。某天从生产的产品中随机抽取25块合金。计算该检验的功效函数。

答：

\begin{itemize}
%\item 拒绝域 $W=\{\bar{x}\le c\}$.
\item 势函数 $g(\theta)=P_\theta(\bar{X}\le c)=\Phi(\frac{c-\theta}{4/5})$.
\item 弃真概率 $\alpha(\theta)=\Phi(\frac{c-\theta}{4/5}),\, \theta\in\Theta_0$.
\item 取伪概率 $\beta(\theta)=1-\Phi(\frac{c-\theta}{4/5}),\, \theta\in\Theta_1$. (为什么?)
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：什么是假设检验的显著性水平？

答：

\begin{itemize}
\item 问题：$H_0:\theta\in\Theta_0 \,\,\mathrm{v.s.}\,\, H_1:\theta\in\Theta_1$. 
\item 若 $\forall \theta\in\Theta_0$, 都有 $g(\theta)\le\alpha$, 则称该检验的显著性水平为 $\alpha$.
\item 给出显著性水平是为了控制第一类错误发生的概率 $\alpha$. (但 $\alpha$ 过小会导致 $\beta$ 过大。)
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：什么是拒绝域？

答：

\begin{itemize}
\item 若样本观测值落入拒绝域，就要拒绝原假设。
\item 拒绝域也指统计量落入的相应的区间。
\item 确定显著性水平 $\alpha$ 后，可以确定拒绝域 $W$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：什么是检验的 $p$ 值？

答：

\begin{itemize}
\item 在假设检验问题中，利用样本观测值能够作出拒绝原假设的最小的显著性水平，称为这次检验的 $p$ 值。
\item 如果 $\alpha\ge p$, 则在显著性水平 $\alpha$ 下拒绝原假设。
\item 确定 $p$ 值，要先看单侧检验还是双侧检验。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设总体 $N(\mu,\sigma^2)$, 方差 $\sigma^2$ 已知，如何检验 
\[ H_0:\mu\le\mu_0 \,\,\mathrm{v.s.}\,\, H_1:\mu>\mu_0. \,\,\, (\textrm{显著性水平为 } \alpha) ? \]

答：

\begin{itemize}
\item 选用统计量 $U=\frac{\bar{X}-\mu_0}{\sigma/\sqrt{n}}$. （称为$u$检验）
\item 画拒绝域 $W=\{u\ge u_{1-\alpha}\}$. 算统计值且判断。
\item 计算势函数 $g(\mu)=1-\Phi(\frac{\mu_0-\mu}{\sigma/\sqrt{n}} +u_{1-\alpha} )$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设总体 $N(\mu,\sigma^2)$, 方差 $\sigma^2$ 已知，如何检验 
\[ H_0:\mu\le\mu_0 \,\,\mathrm{v.s.}\,\, H_1:\mu>\mu_0. \,\,\, (\textrm{显著性水平为 } \alpha)  ? \]

答：

\begin{itemize}
\item 统计量的观测值： $u_0=\frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}$.
\item 计算 $p$ 值：$p=\mathbb{P}(U\ge u_0)$.
\item 若 $p\le\alpha$, 则拒绝原假设。

\end{itemize}


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：从甲地发送一个信号到乙地。设乙地接受到的信号是一个服从正态分布 $N(\mu,0.2^2)$ 的随机变量。其中 $\mu$ 是甲地发送的真实信号值。现甲地重复发送同一信号五次，乙地收到的信号值为 8.05, 8.15, 8.2, 8.1, 8.25. 设接受方有理由猜测甲地发送的信号值是 8. 问能否接受这猜测？ 

答：

\begin{itemize}
\item $H_0: \mu_0=8$. 取 $\alpha=0.05$. 取统计量 $U=\frac{\bar{X}-\mu_0}{\sigma/\sqrt{n}}$.
\item 统计值 $u=1.68$ 未落入拒绝域。接受原假设。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设总体 $N(\mu,\sigma^2)$, 方差 $\sigma^2$ 未知。如何检验
\[ H_0:\mu\le\mu_0 \,\,\mathrm{v.s.}\,\, H_1:\mu>\mu_0. \,\,\, (\textrm{显著性水平为 } \alpha) ? \]

答：

\begin{itemize}
\item 选用统计量 $T=\frac{\bar{X}-\mu_0}{S/\sqrt{n}}$. （称为$t$检验）
\item 拒绝域 $W=\{t\ge t_{1-\alpha}(n-1)\}$.
\item $p$值：$p=\mathbb{P}(T\ge t_0)$, 统计值：$t_0=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：某厂生产的某种铝材的长度服从正态分布，设均值设定为 240cm. 现在从该厂抽取5件产品，测得其长度为 239.7, 239.6, 239, 240, 239.2 (cm). 判断该厂此类铝材的长度是否满足设定的要求？

答：

\begin{itemize}
\item 选用统计量 $T=\frac{\bar{X}-\mu_0}{S/\sqrt{n}}$.
\item 统计值 $t_0=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}=-2.795$.
\item $p$值：$p=\mathbb{P}(T\ge t_0)=0.04905681$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：叙述假设检验和区间估计的关系。

答：

\begin{itemize}
\item 若原假设断言的参数取值没有落在置信区间里，则要拒绝原假设。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：两个正态总体的均值差的检验有哪些类型？分别用什么统计量？

答：

\begin{itemize}
\item 两方差已知：用 $U=\frac{\bar{X}-\bar{Y}}{SEDM}\sim N(0,1)$. 
\item 两方差相等但未知：用 $T=\frac{\bar{X}-\bar{Y}}{SEDM}\sim t(\cdot)$. 
\item 两方差未知：(1) 大样本； (2) 小样本。
\item {\color{red}SEDM = 均值差的标准误} = 分别是什么？
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：现有两种合金的耐磨性指标如下：
镍合金：76.43, 76.21, 73.58, 69.69, 65.29, 70.83, 82.75, 72.34; 
铜合金：73.66, 64.27, 69.34, 71.37, 69.77, 68.12, 67.27, 68.07, 62.61.
判断镍合金的硬度是否比铜合金有显著提高？($\alpha=0.05$)

答：

\begin{itemize}
\item 计算 $sedm=\sqrt{\frac{7s_x^2+8s_y^2}{15}}\cdot\sqrt{\frac{1}{8}+\frac{1}{9}}=2.110$.
\item 计算 $t=\frac{\bar{x}-\bar{y}}{sedm}=2.423$, $p=0.0142<\alpha$. 
\end{itemize}


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：样本数据的类型有哪些？

答：

\begin{itemize}
\item 单样本数据。
\item 独立的双样本数据。
\item 配对的双样本数据：要转化为单样本数据。
\item 其它类型。
\end{itemize}



\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：为比较两种谷物种子的优劣，选10块土质不全相同的土地，并将每块土地分成面积相同的两部分，分别种植着两种种子。其余种植条件都一样。设单位产量如下，判断这两种种子是否有显著差异？
\begin{table}[ht]\centering
\begin{tabular}{c|c|c|c|c}
土地 & 1 & 2 & $\cdots$ & 10 \\
\hline
种子一的产量  & 23 & 35 & $\cdots$ & 28 \\
\hline
种子二的产量  & 30 & 39 & $\cdots$ & 31 \\
\end{tabular}
\end{table}

%答：二样本$t$检验与配对样本$t$检验的结论不同。
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设总体 $N(\mu,\sigma^2)$, $\mu$ 未知。如何检验假设：
\[ H_0:\sigma^2=\sigma_0^2 \,\,\mathrm{v.s.}\,\, H_1:\sigma^2\neq\sigma_0^2. \,\,\, (\textrm{显著性水平为 } \alpha) ? \]

答：

\begin{itemize}
\item 取检验统计量 $\chi^2=\frac{(n-1)S^2}{\sigma_0^2}$.
\item 在 $H_0$ 成立的条件下，$\chi^2\sim \chi^2(n-1)$.
\item 画出$\chi^2(n-1)$ 的密度函数，确定拒绝域。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：某类钢板每块的重量服从正态分布，其一项质量指标是重量的方差不得超过 0.016. 现从某天生产的钢板中随机抽取25块，测得样本方差为 $s^2=0.025$. 问这天生产的钢板是否满足要求？($\alpha=0.05$).

答：

\begin{itemize}
\item 检验问题：$H_0:\sigma^2\le\sigma_0^2 \,\,\mathrm{v.s.}\,\, H_1:\sigma^2>\sigma_0^2.$
\item 统计量 $\chi^2=\frac{(n-1)S^2}{\sigma_0^2}$. 统计值 $\chi^2=\frac{(n-1)s^2}{\sigma_0^2}$. 
\item 画$\chi^2(24)$ 的密度函数，统计值是否在拒绝域。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设样本 $X_1,\cdots,X_m$ 来自 $N(\mu_1,\sigma_1^2)$, 另一组样本 $Y_1,\cdots,Y_n$ 来自 $N(\mu_2,\sigma_2^2)$, 
如何检验假设：
\[ H_0:\sigma_1^2=\sigma_2^2 \,\,\mathrm{v.s.}\,\, H_1:\sigma_1^2\neq\sigma_2^2. \,\,\, (\textrm{显著性水平为 } \alpha) ? \]

答：

\begin{itemize}
\item 构造统计量 $F=S_1^2/S_2^2$.
\item 在 $H_0$ 成立的条件下，$F\sim F(m-1,n-1)$.
\item 画出$F(m-1,n-1)$ 的密度函数，确定拒绝域。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：甲乙两台机床加工某种零件，其直径服从正态分布。总体方差反映了加工精度。分别抽取7件产品和8件产品，测得直径为：甲：16.2, 16.8, 15.8, 15.5, 16.7, 15.6, 15.8; 乙：15.9, 16.0, 16.4, 16.1, 16.5, 15.8, 15.7, 15.0. 
试比较两台机床的加工精度有无差别。($\alpha=0.05$).

答：

\begin{itemize}
\item 提出假设 $H_0:\sigma_1^2=\sigma_2^2 \,\,\mathrm{v.s.}\,\, H_1:\sigma_1^2\neq\sigma_2^2$.
\item 使用统计量 $F=S_1^2/S_2^2$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：（指数分布的参数检验）设总体服从指数分布 $X\sim Exp(1/\theta)$, 均值 $\mu=\theta$. 设显著性水平 $\alpha$. 如何检验
\[ H_0:\theta\le\theta_0 \,\,\mathrm{v.s.}\,\, H_1:\theta>\theta_0 \,\, ? \]

答：

\begin{itemize}
\item 使用参数 $\theta$ 的充分统计量 $\chi^2=\frac{2n\bar{X}}{\theta_0} \sim \chi^2(2n)$.
\item 确定拒绝域：$W=\{\chi^2\ge \chi^2(2n)\}$. 
\item 计算 $p$ 值：$p=\mathbb{P}(\chi^2\ge \frac{2n\bar{x}}{\theta_0})$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设要检验某种元件的平均寿命是否不小于6000小时。设总体寿命服从指数分布。检测5个元件，测得失效时间为
395, 4094, 119, 11572, 6133 (小时)。检验该假设。

答：

\begin{itemize}
\item 选统计量。
\item 确定拒绝域。
\item 计算$p$值。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：（比率的检验）设某事件发生的概率为$p$. 作 $n$ 次独立试验，测得该事件发生 $m$ 次。如何检验
\[ H_0: p\le p_0 \,\,\mathrm{v.s.}\,\, H_1: p> p_0 \,\, ? \]

答：

\begin{itemize}
\item 随机变量 $M$ 服从二项分布 $b(n,p_0)$.
\item 假设比率是 $p_0$，计算$p$值：$p=P(M\ge m\,|\, p_0)$. 
\item 若 $p<\alpha$ 则拒绝原假设。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设某厂生产的产品的优质品率一直保持在 40\%. 近期抽检20件，发现有优质品7件。在 $\alpha=0.05$ 下能否认为优质品率仍保持在 40\% ?

答：

\begin{itemize}
\item 优质品件数 $T\sim b(20,p)$.
\item 检验假设 \( H_0: p=0.4 \,\,\mathrm{v.s.}\,\, H_1:p\neq 0.4. \)
\item 计算 $p$ 值：$p=2\min\{ P(T\le 7), P(T\ge 7) \}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：（大样本检验）设总体分布 $F(x;\theta)$. 设总体均值为 $\theta$, 方差为 $\sigma^2(\theta)$. 如何检验
\[ H_0:\theta\le\theta_0 \,\,\mathrm{v.s.}\,\, H_1:\theta>\theta_0 \,\, ? \]

答：

\begin{itemize}
\item 由中心极限定理，$\bar{X}\,\,\dot{\sim}\,\, N(\theta, \sigma^2(\theta)/n)$. 
\item 构造统计量  $U=\frac{\bar{X}-\theta_0}{\sqrt{\sigma^2(\theta)/n}}$, 计算 $p$ 值。
\item 拒绝域 $W=\{ u\ge u_{1-\alpha} \}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：某厂生产的产品不合格率不高于 10\%. 一次检查80件，发现有11件不合格品。在 $\alpha=0.05$ 下能否认为不合格率仍然是 10\% ?

答：

\begin{itemize}
\item 检验假设 \( H_0: p\le 0.1 \,\,\mathrm{v.s.}\,\, H_1:p> 0.1. \)
\item 统计量  $U=\frac{\bar{X}-\theta_0}{\sqrt{\hat{\theta}(1-\hat{\theta})/n}} \,\,\dot{\sim}\,\, N(0,1) $.
\item 拒绝域 $W=\{ u\ge 1.645\}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：某建筑公司宣称其麾下建筑工地平均每天发生事故数不超过 0.6 起。现记录某工地200天的安全生产情况，事故记录如下。设 $\alpha=0.05$. 检验该公司的宣称是否成立。

\begin{table}[ht]\centering
\begin{tabular}{c|c|c|c|c|c|c|c|c}
%\hline
事故数& 0 &1  &2 &3 &4&5&$\ge 6$ & 总计 \\
\hline
天数&102  &59  &30 &8 &0&1&0&200 \\
%\hline
\end{tabular}
\end{table}

答：设总体为泊松分布$P(\lambda)$. $H_0:\lambda\le 0.6$ ?

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

%问：如何理解似然比函数？
问：什么是似然比检验？


答：

设总体密度函数为 $p(x;\theta), \theta\in\Theta$. 设 $X_1,\cdots,X_n$ 是样本。考虑检验
\( H_0: p\in\Theta_0, \,\,\mathrm{v.s.}\,\, H_1:p\in\Theta-\Theta_0. \)
取检验统计量
\vspace{-0.5cm}
\[\Lambda(x_1,\cdots,x_n)=\frac{p(x_1,\cdots,x_n;\hat{\theta})}{p(x_1,\cdots,x_n;\hat{\theta}_0)}\] 
%其中：\\ 
拒绝域为 $W=\Lambda(x_1,\cdots,x_n)\ge c$.
\\
$\hat{\theta}={\mathrm{argsup}} \{p(x_1,\cdots,x_n;\theta) \,|\, \theta\in\Theta \} $,\\
$\hat{\theta}_0={\mathrm{argsup}} \{p(x_1,\cdots,x_n;\theta) \,|\, \theta\in\Theta_0 \} $.

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设总体是正态分布 $N(\mu,\sigma^2)$, 两个参数都未知。求下述问题的似然比检验（$\alpha=0.05$）：
\[ H_0: \mu=\mu_0, \,\,\mathrm{v.s.}\,\, H_1:\mu\neq\mu_0. \]

答：

\begin{itemize}
\item 写出两个参数空间 $\Theta_0$ 和 $\Theta_1$.
\item 在这两个参数空间求出 $\mu,\sigma^2$ 的极大似然估计。
\item 写出似然比估计量、与拒绝域。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：什么是分布的拟合检验？

答：

\begin{itemize}
\item 对总体分布的形式建立假设、并检验。
\item 是一类非参数检验。
\item 解释皮尔逊定理。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：孟德尔按颜色和形状把豌豆分为四类，并按他的原理判断比例为9:3:3:1. 一次试验中收获556个豌豆，四类豌豆的个数为315, 108, 101, 32. 问该数据是否与孟德尔提出的比例吻合？

答：

\begin{itemize}
\item $H_0$: 第 $i$ 类所占的比例为 $p_{i0}$, $1\le i\le r$.
\item 统计量 $\chi^2=\sum_{i=1}^{r}\frac{(n_i-np_{i0})^2}{np_{i0}}$. (实际与理论之差)
\item 拒绝域 $W=\{\chi^2\ge\chi^2_{1-\alpha} (r-1)\}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：用似然比检验得到皮尔逊拟合优度检验？

答：

\begin{itemize}
\item 两个参数空间中的极大似然估计。
\item 写出似然比统计量。
\item 对数似然函数。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：卢瑟福观测一枚放射性物质在单位时间内放射出的质点数目，检验该数目是否服从泊松分布？

\begin{table}[ht]\centering
\begin{tabular}{c|c|c|c|c|c|c|c}
%\hline
质点数& 0 &1  &2 &3 &4&5 &$\cdots$  \\
\hline
观测数&57  &203  &383 &525 &532 &408 &$\cdots$ \\
%\hline
\end{tabular}
\end{table}

答：

\begin{itemize}
\item 先估计参数，再 $\chi^2$ 拟合优度检验。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：某工厂生产一种滚珠，随机抽取50件，测得直径见数据文件。问滚珠直径是否服从正态分布？

答：

\begin{itemize}
\item MLE 方法估计参数 $\mu,\sigma^2$.
\item 取分点把数据分成5组，每组不少于5个数据。
\item 用 $\chi^2$ 拟合优度检验。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：列联表的独立性检验。

答：

\begin{itemize}
\item $H_0$: 行因素和列因素是独立的。
\item 统计量 $\chi^2=\sum_i\sum_j \frac{(n_{ij}-n\hat{p}_{ij})^2}{n\hat{p}_{ij}} \sim \chi^2(df)$.
\item 极大似然估计：$\hat{p}_{ij}=\hat{p}_{i\cdot}\hat{p}_{\cdot j}\overset{mle}{=}\frac{n_{i\cdot}}{n}\frac{n_{\cdot j}}{n}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：为了研究儿童智力发展与营养的关系，某研究机构调查了1436名儿童，得到列联表数据。在显著性水平 0.05 下判断智力发展和营养有无关系。

答：

\begin{itemize}
\item 原假设：营养与智力无关，即行与列独立。
\item $\chi^2$ 统计量。
\item 自由度、拒绝域。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：简述正态性检验有哪些？

答：

\begin{itemize}
\item 正态概率图。(qqnorm plot)
\item W检验、EP检验。
%\item 
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：随机选取10个零件，测得直径与标准尺寸的偏差如下：
9.4, 8.8, 9.6, 10.2, 10.1, 7.2, 11.1, 8.2, 8.6, 9.8.
问这些偏差是否服从正态分布？

答：

\begin{itemize}
\item 将数据从小到大排列 $x_{(1)}\le \cdots \le x_{(n)}$.
\item 计算修正频率 $p_i=\frac{i-0.375}{n+0.25}$.
\item 将点 $(x_{(i)},p_i), i=1,2,\cdots,n$ 画在正态概率图上，判断是否成直线。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：解释 Shapiro-Wilk 正态性检验。

答：

\begin{itemize}
\item W检验衡量了样本的次序统计量与正态分布的分位数组成的点对在一条直线上的程度。
\item 若相关系数接近1, 则认为数据服从正态分布。
\item 从相关系数的平方构造检验{\color{red}统计量$W$}. 
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：解释 Epps-Pulley 正态性检验。

答：

\begin{itemize}
\item 比较样本数据的特征函数与正态分布的特征函数的差。若差别较大则拒绝样本数据服从正态分布的假设。
\item 设样本 $X_1,\cdots,X_n$, 构造 EP 统计量 $T_{EP}=?$
\item 拒绝域 $T_{EP}\ge T_{1-\alpha,EP}(n)$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：考察某种纱线的强度的分布类型，实验得到了一个容量为25的样本：
147, 186, 141, 183, 190, 123, 155, 164, 183, 150, 134, 170, 
144, 99, 156, 176, 160, 174, 153, 162, 167, 179, 78, 173, 168.
用 EP 检验判断总体是否服从正态分布。

答：

\begin{itemize}
\item 编程计算EP统计值 $T_{EP}=$ 
\item 查表11得拒绝域的左端点 $T_{0.99,EP}(25)=$
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：如何检验数据的随机性？

答：

\begin{itemize}
\item 使用{\color{red}游程检验}的方法。
\item 将数据中比中位数小的换成0, 比中位数大的换成1. 这样原数据换成了0,1序列。
\item 设序列中0和1的个数分别为 $n_1$ 和 $n_2$, 其和为样本量 $n$. {\color{red}设 $R$ 表示序列的总游程数。}若总游程数过大或过小，则认为样本数据不是随机的。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设序列中0和1的个数分别为 $n_1$ 和 $n_2$, 其和为样本量 $n$. 求序列的总游程数 $R$ 的分布列。

答：

\begin{itemize}
\item $R$ 的取值范围是 $2, 3, \cdots, n$.
\item $P(R=2k)=$ （编程）
\item $P(R=2k+1)=$ （编程）
\item 从 $R$ 的分布列求出游程检验的$p$值。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：对某型号的20根电缆依次进行耐压试验，测得数据如下：156.0, 255.5, 132.0, 246.7, 867.9, 86.4, 610.4, 125.7, 150.4, 117.6, 201.9, 207.2, 189.8, 585.8, 153.1, 565.4, 511.0, 567.0, 222.3, 141.5. 
这些数据能否认为受到非随机因素的干扰？

答：

\begin{itemize}
\item 计算中位数，将原数列换成0,1序列。计算游程数$R=13$. 
查表12知 $P(R\le 6)\le 0.025$, $P(R\ge 16)\le 0.025$. 故没落在拒绝域。
\end{itemize}


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：如何用游程检验两个总体是否有相同分布？

答：

\begin{itemize}
\item 考虑样本序列 $x_1,\cdots,x_n$, $y_1,\cdots,y_m$ 的游程。
\item 若分布均值不同，则总游程数 $R$ 会较小。
\item 拒绝域 $R\le c$, 其中 $c$ 由 $R$ 的分布列求得。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设总体为连续分布，分布函数为 $F(x)$, 设样本 $x_1,\cdots,x_n$, 如何检验 $F$ 的中位数为零？即：
\[ H_0: F(0)=0.5, \,\,\mathrm{v.s.}\,\, H_1:F(0)\neq 0.5. \]

答：

\begin{itemize}
\item {\color{red}符号统计量} $S^+$ 为样本中取正数的个数。
\item 若 $H_0$ 为真，则 $S^+ \sim b(n,0.5)$.
\item 拒绝域 $W = \{ S^+\le c_1\} \cup \{S^+\ge c_2\}$.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：资料表明，某种圆钢的90\%的产品的硬度不小于103. 现随机挑选20根圆钢进行试验，测得其硬度分别为：
142, 134, 119, 98, 131,102, 154, 122, 93, 137, 
86, 119, 161, 144, 158, 165, 81, 117, 128, 113. 
检验 \( H_0: x_{0.10}\ge 103, \,\,\mathrm{v.s.}\,\, H_1:x_{0.10}< 103. \)

答：

\begin{itemize}
\item 作差值 $x_i-103$, 求出符号为正的个数 $S_0^+=15$. 检验的 $p$ 值小于0.05,  因此拒绝原假设。
\(p=P(S_0^+\le 15)=\sum_{i=0}^{15}\binom{20}{i}(0.1)^i(0.9)^{20-i}=0.043.\) 

\end{itemize}


\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：解释秩检验。

答：

\begin{itemize}
\item 设有来自连续总体的样本 $x_1,\cdots,x_n$. 观测值 $x_i$ {\color{red}在有序样本中的序号}称为它的秩，记为 $R_i$. 
\item $R=(R_1,\cdots,R_n)$ 称为样本 $x_1,\cdots,x_n$ 的秩统计量。基于秩统计量的检验称为秩检验。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：设某样本的观测值为 $$(x_1,\cdots,x_6)= (196, 224, 171, 241, 162, 193).$$
计算该样本的秩 $(R_1,\cdots,R_6)$.

答：用 R 程序的 rank() 函数即得 $$(R_1,\cdots,R_6)=(4,5,2,6,1,3),$$
即 $x_1$ 是从小到大第4名，等等。

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：解释秩和检验。

答：

\begin{itemize}
\item 求出样本 $x_1,\cdots,x_n$ 的绝对值序列  $|x_1|,\cdots,|x_n|$ 的秩统计量 $R=(R_1,\cdots,R_n)$.
\item 定义{\color{red}符号秩和统计量} $W^+ = \underset{x_i>0}\sum R_i$.
\item 若 ``$H_0$: 样本的中位数为0'' 为真，则 $W^+$ 不会太大也不会太小。由此求出拒绝域。
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{7. }

问：为评估某处理羊绒含脂率的工艺，收集了6组处理前的羊绒和5组处理后的羊绒，测得含脂率如下，问处理后的含脂率是否明显下降了？

\begin{table}[ht]\centering
\begin{tabular}{c|c|c|c|c|c|c}
%\hline
处理前& 0.20 &0.24  &0.66 &0.42 &0.12 &0.25   \\
\hline
处理后&0.13  &0.07  &0.21 &0.08 &0.19 & \\
%\hline
\end{tabular}
\end{table}


答：将样本从小到大排序，求出第二组的秩和 $W=19$, 查表得拒绝域为 $W\le 20$, 因此拒绝处理后含脂率没有下降的零假设。

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


